package collection;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;

/**
 * 说明:
 *
 * @author:SuZhongHe
 * @date:2023/3/2
 **/
public class CollectionToArrayDemo {
    public static void main(String[] args) {
        Collection<String> o = new ArrayList<>();
        o.add("a");
        o.add("b");
        o.add("c");
        o.add("d");
        o.add("e");
        System.out.println(o);
        String[] array = o.toArray(new String[5]);
        System.out.println(Arrays.toString(array));
    }
}
